#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  n = n * 2 + 1;
  m = m * 2 + 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      char k;
      if (i % 2 == 1)
        k = ((j % 2 == 1) ? '+' : '-');
      else
        k = ((j % 2 == 1) ? '|' : ' ');

      cout << k;
    }
    cout << endl;
  }

  return 0;
}